#ifndef __MUSIC_NOTE_AND_INDEX_UTILS_H__
#define __MUSIC_NOTE_AND_INDEX_UTILS_H__

//不能这样定义, 否则定义歌曲 code unsigned char Music[] 的时候会报错, 会把以下字母识别成常量?
// code const unsigned char P = 0,
//                    L1 = 1, L1_ = 2, L2 = 3, L2_ = 4, L3 = 5, L4 = 6, L4_ = 7, L5 = 8, L5_ = 9, L6 = 10, L6_ = 11, L7 = 12,
//                    M1 = 13, M1_ = 14, M2 = 15, M2_ = 16, M3 = 17, M4 = 18, M4_ = 19, M5 = 20, M5_ = 21, M6 = 22, M6_ = 23, M7 = 24,
//                    H1 = 25, H1_ = 26, H2 = 27, H2_ = 28, H3 = 29, H4 = 30, H4_ = 31, H5 = 32, H5_ = 33, H6 = 34, H6_ = 35, H7 = 36,
//                    MUSIC_END = 0xFF;

//枚举也不行
// code enum MUSIC_NOTES {
//     P,
//     L1, L1_, L2, L2_, L3, L4, L4_, L5, L5_, L6, L6_, L7,
//     M1, M1_, M2, M2_, M3, M4, M4_, M5, M5_, M6, M6_, M7,
//     H1, H1_, H2, H2_, H3, H4, H4_, H5, H5_, H6, H6_, H7,
//     MUSIC_END = 0xFF
// };

/**
 * 音符与索引对应表
 * P：休止符(无声)
 * L：低音
 * M：中音
 * H：高音
 * 下划线：升半音符号#
 * MUSIC_END: 音乐终止标志
 */
#define P   0
#define L1  1
#define L1_ 2
#define L2  3
#define L2_ 4
#define L3  5
#define L4  6
#define L4_ 7
#define L5  8
#define L5_ 9
#define L6  10
#define L6_ 11
#define L7  12
#define M1  13
#define M1_ 14
#define M2  15
#define M2_ 16
#define M3  17
#define M4  18
#define M4_ 19
#define M5  20
#define M5_ 21
#define M6  22
#define M6_ 23
#define M7  24
#define H1  25
#define H1_ 26
#define H2  27
#define H2_ 28
#define H3  29
#define H4  30
#define H4_ 31
#define H5  32
#define H5_ 33
#define H6  34
#define H6_ 35
#define H7  36
#define MUSIC_END   0xFF

#endif // !__MUSIC_NOTE_AND_INDEX_UTILS_H__
